﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_Flow_GetBangdingTeam]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_Flow_GetBangdingTeam];
GO
CREATE PROCEDURE [dbo].[sproc_Flow_GetBangdingTeam]
    @FlowID int,
    @StepID int
AS
BEGIN
SET NOCOUNT ON;

SELECT
		b.classid as team_id,
		b.classname as Team_Name 
    FROM 
        dbo.uds_flow_member_bind a ,
        dbo.uds_class b 
    WHERE
		a.obj_id = b.classid 
        and a.flow_id = @flowID 
        and a.step_id = @stepid
        and a.obj_type = 2 /* team */;

END
GO